﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;

//using Microsoft.VisualStudio.TestTools.UnitTesting;

//using Pibby.Core.IO;
//using Pibby.Core.IntegrationTests.Stubs;

//namespace Pibby.Core.Tests
//{
//    [TestClass]
//    public class FileListerTests : IntegrationBaseTestFixture
//    {
//        [TestMethod]
//        public void CanFindAllFilesInSingleFolder()
//        {
//            IFolder folder = new Folder (Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), 25, 0);

//            FileLister lister = new FileLister();
//            lister.ListContentsOf(folder, System.IO.SearchOption.TopDirectoryOnly);

//            Assert.AreEqual(folder.GetFiles().Count, lister.Items.Count);
//        }

//        [TestMethod]
//        public void CanFindAllFilesInFolderHierarchy()
//        {
//            IFolder folder = new Stubs.Folder (Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments), 10, 2);

//            FileLister lister = new FileLister();
//            lister.ListContentsOf(folder, System.IO.SearchOption.AllDirectories);

//            int expectedContent = CountFiles(folder);

//            Assert.AreEqual (expectedContent, lister.Items.Count);
//        }

//        [TestMethod]
//        public void DeepSearchIsSameAsDefaultSearch()
//        {
//            IFolder folder = new Stubs.Folder(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), 10, 2);

//            FileLister allFolderLister = new FileLister();
//            allFolderLister.ListContentsOf(folder, System.IO.SearchOption.AllDirectories);

//            FileLister defaultLister = new FileLister();
//            defaultLister.ListContentsOf(folder);
			
//            int expectedContent = CountFiles(folder);

//            Assert.AreEqual(expectedContent, allFolderLister.Items.Count);
//            Assert.AreEqual(allFolderLister.Items.Count, defaultLister.Items.Count);
//        }

//        private int CountSubFolders(IFolder folder)
//        {
//            int count = 0;

//            foreach (IFolder sub in folder.GetSubfolders())
//            {
//                count += CountSubFolders(sub);
//            }

//            return count;
//        }

//        private int CountFiles(IFolder folder)
//        {
//            int count = folder.GetFiles().Count;

//            foreach (IFolder sub in folder.GetSubfolders())
//            {
//                count += CountFiles(sub);
//            }

//            return count;
//        }

//    }
//}
